package com.ewanghuiju.app.ui.shopmail.adapter;

import android.graphics.Paint;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.ewanghuiju.app.R;
import com.ewanghuiju.app.model.bean.local.MailShopBean;
import com.ewanghuiju.app.model.bean.response.PintuanHotTuijianResponBean;

/***
 * 优惠券板块 店铺商品列表
 */

public class MailStoreAdapter extends BaseQuickAdapter<MailShopBean, BaseViewHolder> {
    public MailStoreAdapter(int layoutResId) {
        super(layoutResId);
    }

    @Override
    protected void convert(BaseViewHolder helper, MailShopBean item) {
        helper.setVisible(R.id.layout_yhq,true);
        helper.setText(R.id.tv_yhq, item.getYhq());
        helper.setText(R.id.tv_zhuan, item.getZmoney());


        helper.setText(R.id.tv_title, item.getTitle());
        helper.setText(R.id.tv_now_price, item.getNow_price());
        helper.setText(R.id.tv_buynum, item.getNumber()+"人正抢购");
        TextView tv_yuan = helper.getView(R.id.tv_yuan_price);
        tv_yuan.setText("￥"+item.getYuan_price());
        tv_yuan.getPaint().setFlags(Paint.STRIKE_THRU_TEXT_FLAG | Paint.ANTI_ALIAS_FLAG); // 设置中划线并加清晰
        ImageView iv = helper.getView(R.id.riv_shop_img);
        Glide.with(mContext).load(item.getImage()).into(iv);
    }
}
